package com.fauks.study.msdata.mapper;

import com.fauks.study.msdata.pojo.Emp;
import org.apache.ibatis.annotations.*;

/**
 * 注解版mybatis
 */
@Mapper
public interface EmpMapper {

    @Select("select * from employee where id=#{id}")
    Emp getEmpById(Integer id);

    @Update("update employee set lastName=#{lastName} where id=#{id}")
    void updateById(Emp emp);

    @Options(useGeneratedKeys = true)
    @Insert("insert into employee (lastName,email,gender) values (#{lastName},#{email},#{gender})")
    void insert(Emp emp);
}
